Make: Wearable Electronics by Kate Hartman
Author:Kate Hartman
Language: eng
Format: epub, mobi
Tags: COMPUTERS / Hardware / General
ISBN: 9781449336509
Publisher: Maker Media, Inc
Published: 2014-08-12T04:00:00+00:00
map(lightSensorValue, 25, 940, 0, 255)
Figure 7-14. Mapping a value from 25–940 to 0–255
If you are working with a LilyPad light sensor as your input and using the mapped value to control an LED on the analog output pin, you would have an LED that brightens and dims in a way that mimics the conditions of the room. If you wanted to inverse the relationship so that the LED gets brighter as the room gets darker, you can simply flip the to values, as illustrated in Figure 7-15:
map(lightSensorValue, 25, 940, 255, 0)
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Wonder by R.J. Palacio(8256)
Unlabel: Selling You Without Selling Out by Marc Ecko(3460)
Mastering Adobe Animate 2023 - Third Edition by Joseph Labrecque(3336)
Ogilvy on Advertising by David Ogilvy(3314)
Hidden Persuasion: 33 psychological influence techniques in advertising by Marc Andrews & Matthijs van Leeuwen & Rick van Baaren(3283)
Drawing Cutting Edge Anatomy by Christopher Hart(3280)
POP by Steven Heller(3222)
The Pixar Touch by David A. Price(3195)
The Code Book by Simon Singh(2845)
The Art of War Visualized by Jessica Hagy(2827)
The Curated Closet by Anuschka Rees(2793)
Slugfest by Reed Tucker(2785)
Rapid Viz: A New Method for the Rapid Visualization of Ideas by Kurt Hanks & Larry Belliston(2720)
Stacked Decks by The Rotenberg Collection(2673)
The Wardrobe Wakeup by Lois Joy Johnson(2628)
365 Days of Wonder by R.J. Palacio(2614)
Keep Going by Austin Kleon(2590)
Tell Me More by Kelly Corrigan(2514)
Tattoo Art by Doralba Picerno(2481)
